import React ,{ Component } from 'react';
import './recommend.css';
import {withRouter} from 'react-router-dom';


class Recommend extends Component {
  
    goDateil = ()=>{
        this.props.history.push('/detail');
    }

    render () {
        return (
            <div className="recommend">
               <div className="title">热品推销</div>

               {
                   this.props.recommendData.map((item,index)=>{
                     return <div className="itemList" key={item.id} onClick={this.goDateil.bind(this)}>
                                <div className="imgBox_recom">
                                    <img alt="img" src={item.imgUrl}/>
                                </div>
                                <div className="rightBox">
                                    <h3 className="rightBox_title">{item.title}</h3>
                                    <p className="rightBox_detail">{item.desc}</p>
                                    <div className="rightBox_go">
                                        <span>查看详情</span>
                                    </div>
                                </div>   
                            </div>
                   })
               }
               
               
            </div>
        )
    }
}
export default withRouter(Recommend);